<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0027)http://www.chinaidcard.com/ -->
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="UTF-8">
    <title>学员录入</title>
    <link href="../../layui/css/layui.css" rel="stylesheet">
    <link href="css/layuiAdmin.css" rel="stylesheet">
    <link href="../../static/css/style.css" rel="stylesheet">
    <script src="../../static/js/jquery.min.js"></script>
    <script src="../../static/js/jquery.cookie.js"></script>
    <script src="../../layui/layui.js"></script>
    <script src="../../static/js/base.js"></script>
    <script src="../../static/js/ax.js"></script>
    <script src="../../static/js/avalon.js"></script>
    <script src="js/constant.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="../../static/js/html5.js"></script>
    <script src="../../static/js/respond.js"></script>
    <![endif]-->
    <style>
        .layui-upload-img{
            overflow: hidden
        }
    </style>

</head>

<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header hearder_title">
            <h5>学员基本信息</h5>
        </div>
        <div class="content-wrap" ms-controller="test">
            <form class="layui-form layui-form-pane" action="">
                <OBJECT classid="clsid:10946843-7507-44FE-ACE8-2B3483D179B7"
                        id="CVR_IDCard" name="CVR_IDCard" width="0" height="0" >
                </OBJECT>
                <div class="layui-row add_student layui-form-item ">
                    <div class="layui-col-md10">
                        <div class="">
                            <!----1-->
                            <div class="layui-row">
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">姓名：</label>
                                    <div class="layui-input-block" style="position: relative;">
                                        <input type="text" maxlength="50" lay-verify="required"  ms-duplex="@name" name="name" class="layui-input">
                                        <input id="Button"  class="layui-btn add_btn layui-btn-radius" type="button" value="读   卡" :click='@readcard()'
                                               style="position: absolute;right:2px;top: 4px; line-height: 30px; height: 30px;"
                                        />

                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">证件类型：</label>
                                    <div class="layui-input-block">
                                        <select name="sfType" id="sfType" ms-duplex="@sfType" lay-verify="required" lay-filter="aihao">
                                            <option value="">请选择</option>
                                            <option :for="($index,el) in @zjTypeList" ms-attr="{value:el.id}">{{el.code}}</option>

                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">出生日期：</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="birthday" lay-verify="required" ms-duplex="@birthday" class="layui-input">
                                    </div>
                                </div>


                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">证件号码：</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" lay-verify="required"  ms-duplex="@certificatesNumber" name="certificatesNumber">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">国籍：</label>
                                    <div class="layui-input-block">
                                        <select name="country" lay-verify="required" lay-filter="county" ms-duplex="@country" lay-filter="aihao">
                                            <option value="">请选择</option>
                                            <option value="重庆">重庆</option>
                                            <option value="四川">四川</option>
                                            <option value="云南">云南</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">身份证有效期至：</label>
                                    <div class="layui-input-block">
                                        <input type="text" lay-verify="required"  ms-duplex="@expiredDate" class="layui-input"
                                               name="expiredDate">
                                    </div>
                                </div>




                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">性别：</label>
                                    <div class="layui-input-block">
                                        <!--<input type="text" class="layui-input" lay-verify="required"  ms-duplex="@sex" name="Sex">-->
                                        <input type="text"  name="sex" disabled  ms-duplex="@sex" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-col-lg8 layui-col-md6 layui-xs12">
                                    <div class="layui-form-item" pane style="margin-bottom: 0;">
                                        <label class="layui-form-label">学习类别：</label>
                                        <div class="layui-input-block">
                                            <input type="radio" name="studyType" lay-verify="required" ms-duplex="@studyType" value="first" title="初次申领">
                                            <input type="radio" name="studyType" lay-verify="required" ms-duplex="@studyType" value="add" title="增驾">
                                        </div>
                                    </div>

                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">手机号码：</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="phone" lay-verify="required|phone" maxlength="11" class="layui-input" ms-duplex="@phone" name="phone">
                                    </div>
                                </div>


                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">准驾车型：</label>
                                    <div class="layui-input-block" >
                                        <select name="carId" id="carId" lay-verify="required" ms-duplex="@carId" lay-verify="required" lay-filter="aihao">    <option value="">请选择</option>
                                            <option :for="($index,el) in @carTypeList" ms-attr="{value:el.id}">{{el.code}}</option>

                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">暂住证编号：</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" lay-verify="required" ms-duplex="@stayAddreeNumber" name="stayAddreeNumber">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">电子邮箱：</label>
                                    <div class="layui-input-block">
                                        <input type="text" lay-verify="required|email" name="email" class="layui-input" ms-duplex="@email">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">所属辖区：</label>
                                    <div class="layui-input-block">
                                        <select name="registeredAreaId" lay-verify="required">
                                            <option value="">请选择</option>
                                            <option value="1">所属辖区1</option>
                                            <option value="2">所属辖区2</option>

                                        </select>
                                    </div>
                                </div>

                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">

                                    <label class="layui-form-label">住所详细地址：</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" lay-verify="required" ms-duplex="@addressDetailed" name="addressDetailed">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">报名来源：</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" lay-verify="required" ms-duplex="@registeredSource" name="registeredSource">
                                    </div>
                                </div>


                                <div class="layui-col-lg8 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">登记住所行政区划：</label>
                                    <div class="layui-input-block">
                                        <div class="layui-input " style="padding: 0; box-sizing: border-box;     border: 0;">
                                            <div class="layui-col-lg4 layui-col-md4 layui-xs4" style="width: 33.33%;float: left;">
                                                <select lay-filter="provinceSelect_tow" lay-verify="required" id='driverprovinceId_tow' ms-duplex="@provId_2" name="provId">
                                                    <option value="">请选择</option>
                                                    <option ms-attr="{value: el.id}" ms-for="($index, el) in @provlist">{{el.name}}</option>
                                                </select>
                                            </div>
                                            <div class="layui-col-lg4 layui-col-md4 layui-xs4" style="width: 33.33%;float: left;">
                                                <select lay-filter="regionSelect_tow" lay-verify="required" id='drivercityId_tow' ms-duplex="@cityId_1" name="cityId">
                                                    <option value="">请选择</option>
                                                    <option ms-attr="{value: el.id}" ms-for="($index, el) in @citylist_tow">{{el.name}}</option>
                                                </select>
                                            </div>
                                            <div class="layui-col-lg4 layui-col-md4 layui-xs4" style="width: 33.33%;float: left;">
                                                <select lay-filter="areaSelect_tow" lay-verify="required" id='driverareaId_tow' ms-duplex="@areaId_1" name="areaId">
                                                    <option value="">请选择</option>
                                                    <option ms-attr="{value: el.id}" ms-for="($index, el) in @arealist_tow">{{el.name}}</option>
                                                </select>
                                            </div>
                                            <div class="clear:both"></div>
                                        </div>

                                    </div>
                                </div>
                                <div class="layui-col-lg8 layui-col-md12 layui-xs12">
                                    <label class="layui-form-label">登记住所详细地址：</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" readonly ms-duplex="@registeredResidence" name="registeredResidence">
                                        <input id="Button1" readonly class="layui-btn add_btn layui-btn-radius" :click="opeenlay()" type="button" value="非本地"
                                               style="position: absolute;right:2px;top: 4px; line-height: 30px; height: 30px;"
                                        />
                                        <!-- <input type="text" class="layui-input" name="registeredResidence" ms-duplex="@registeredResidence"> -->
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">来源：</label>
                                    <div class="layui-input-block">
                                        <!--  <input type="text" class="layui-input" name="field">-->
                                        <input type="text" class="layui-input" lay-verify="required" id="layerResult"  name="studentSource" ms-duplex="@studentSource">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">学费：</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" lay-verify="required" name="registeredTuition" ms-duplex="@registeredTuition">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">学员编号：</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" lay-verify="required" name="studentNumber" ms-duplex="@studentNumber" id="studentNumber">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">报名日期：</label>
                                    <div class="layui-input-block">
                                        <input type="text" readonly class="layui-input" ms-duplex="@registeredTime" value="<%=new SimpleDateFormat('yyyy-MM-dd').format(new Date()) %>"
                                               name="registeredTime" id="registeredTime">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">机构名称：</label>
                                    <div class="layui-input-block">
                                        <input type="text" readonly  class="layui-input"  id="driversId">
                                    </div>
                                </div>
                                <div class="layui-col-lg4 layui-col-md6 layui-xs12">
                                    <label class="layui-form-label">推荐码：</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" ms-duplex="@referralCode" name="referralCode">
                                    </div>
                                </div>



                                <!--<div class="layui-col-lg4 layui-col-md6 layui-xs12">-->
                                    <!--<label class="layui-form-label">照片编码：</label>-->
                                    <!--<div class="layui-input-block">-->
                                        <!---->
                                    <!--</div>-->
                                <!--</div>-->
                                <input type="hidden" class="layui-input" readonly ms-duplex="@picture" name="picture">

                                <div class="layui-col-xs12">
                                    <label class="layui-form-label" style="height: 120px; line-height: 120px;">备注</label>
                                    <div class="layui-input-block">
                                        <textarea name="reason" ms-duplex="@reason" placeholder="请输入内容" style="height: 120px;" class="layui-textarea" style="min-height: 135px;"></textarea>
                                    </div>
                                </div>

                            </div>

                        </div>
                    </div>

                    <div class="layui-col-md2">
                        <div style="width: 100%; height: auto; padding: 20px 5%; box-sizing: border-box;-webkit-box-sizing: border-box;">
                            <img ms-attr="{src:@pic}" style="max-width: 100%; margin: 0 auto;display: block;">

                        </div>

                    </div>
                </div>

                <!--签字传图-->

                <div class="layui-form-item">
                    <div class="layui-form-item  layui-row ptfile" pane>
                        <div class="layui-col-md4 layui-col-sm6">
                            <label class="layui-form-label">驾校申请表：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img  ms-if="@cxjs" ms-attr="{src:@fileShowUrl +'?id='+@cxjs}">
                                        </div>
                                        <i class="layui-icon layui-icon-close" :click="removeimg('cxjs')" ms-if="@cxjs"></i>
                                        <input type="hidden" name="jzsqId" id="jzsqId" />
                                        <input type="hidden" name="jzsqType" id="jzsqType" value="jzsq" />
                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="jxsq(0)">点击签字</a>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6">
                            <label class="layui-form-label">互联网面签协议：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img  ms-if="@mqb" ms-attr="{src:@fileShowUrl +'?id='+@mqb}">
                                        </div>
                                        <i class="layui-icon layui-icon-close" ms-if="@mqb" :click="removeimg('mqb')"></i>
                                        <input type="hidden" name="mqbId" id="mqbId" />
                                        <input type="hidden" name="mqbType" id="mqbType" value="mqb" />
                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="mianqian(0)">点击签字</a>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6">

                            <label class="layui-form-label">指纹：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img  ms-if="@zw" :for="($index,el) in @zwimglist" ms-attr="{src:el}">
                                        </div>
                                        <!--<i class="layui-icon layui-icon-close" ms-if="@zw" :click="removeimg('zw')"></i>
                                        <input type="hidden" name="zwId" id="zwId" />
                                        <input type="hidden" name="zwType" id="zwType" value="zw" />-->
                                        <input type="hidden" name="zwType" id="zwType" value="zw">
                                        <input type="hidden" id="zwimg1" name="zwimg1" ms-duplex="@zwimg">
                                        <input type="hidden" id="zwimg2" name="zwimg2" ms-duplex="@zwimg">
                                        <input type="hidden" id="zwimg3" name="zwimg3" ms-duplex="@zwimg">

                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="zhiWenluru(0)">上传图片</a>
                                </div>
                            </div>

                        </div>
                        <div class="layui-col-md4 layui-col-sm6">

                            <label class="layui-form-label">证件照：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img  ms-if="@zjzo" ms-attr="{src:@fileShowUrl +'?id='+@zjzo}">
                                        </div>
                                        <i class="layui-icon layui-icon-close" ms-if="@zjzo" :click="removeimg('zjzo')"></i>
                                        <input type="hidden" name="zjzId" id="zjzId" />
                                        <input type="hidden" name="zjzType" id="zjzType" value="zjz" />
                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="imgSC(0,'zjz')">上传图片</a>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6">
                            <label class="layui-form-label">原驾驶证：</label>
                            <div class="layui-input-block">
                                <!--<input type="text" class="layui-input" name="originalDriverLicense">-->
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img  ms-if="@ljz" ms-attr="{src:@fileShowUrl +'?id='+@ljz}">
                                        </div>
                                        <i class="layui-icon layui-icon-close" ms-if="@ljz" :click="removeimg('ljz')"></i>
                                        <input type="hidden" name="yjszId" id="yjszId" />
                                        <input type="hidden" name="yjszType" id="yjszType" value="yjsz" />
                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="imgSC(0,'yjsz')">上传图片</a>

                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6">
                            <label class="layui-form-label">身份证：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img id="cxjsSrc" ms-if="@idz" ms-attr="{src:@fileShowUrl +'?id='+@idz}">
                                        </div>
                                        <i class="layui-icon layui-icon-close" ms-if="@idz" :click="removeimg('idz')"></i>
                                        <input type="hidden" name="sfzId" id="sfzId" />
                                        <input type="hidden" name="sfzType" id="sfzType" value="sfz" />
                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="imgSC(1,'sfz')">上传图片</a>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6">
                            <label class="layui-form-label">体检表图片：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img  ms-if="@tjbtp" ms-attr="{src:@fileShowUrl +'?id='+@tjbtp}">
                                        </div>
                                        <i class="layui-icon layui-icon-close" ms-if="@tjbtp" :click="removeimg('tjbtp')"></i>
                                        <input type="hidden" name="tjbtpId" id="tjbtpId" />
                                        <input type="hidden" name="tjbtpType" id="tjbtpType" value="tjbtp" />
                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="imgSC(0,'tjbtp')">上传图片</a>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-md4 layui-col-sm6">
                            <label class="layui-form-label">现场照片：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img  ms-if="@scenePhotos" ms-attr="{src:@fileShowUrl +'?id='+@scenePhotos}">
                                        </div>
                                        <i class="layui-icon layui-icon-close" ms-if="@scenePhotos" :click="removeimg('scenePhotos')"></i>
                                        <input type="hidden" name="xczId" id="xczId" />
                                        <input type="hidden" name="xczType" id="xczType" value="xcz" />
                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="imgSC(2,'xcz')">上传图片</a>
                                </div>
                            </div>
                        </div>

                        <div class="layui-col-md4 layui-col-sm6">
                            <label class="layui-form-label">居住证照片：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list fileItem" style="visibility:inherit;">
                                        <div class="layui-upload-img" style="visibility:inherit;height: 100px;" class="layui-upload-img">
                                            <img  ms-if="@zzpermit" ms-attr="{src:@fileShowUrl +'?id='+@zzpermit}">
                                        </div>
                                        <i class="layui-icon layui-icon-close" ms-if="@zzpermit" :click="removeimg('zzpermit')"></i>
                                        <input type="hidden" name="jzzId" id="jzzId" />
                                        <input type="hidden" name="jzzType" value="jzz" />
                                    </div>
                                    <a type="button" class="layui-btn layui-btn-primary filebtn" :click="imgSC(0,'jzz')">上传图片</a>
                                </div>
                            </div>
                        </div>
                    </div>


                    <div class="layui-input-block">

                        <button type="reset" class="layui-btn layui-btn-primary btn-left">关闭</button>
                        <button type="reset" class="layui-btn delete_btn btn-left">清空</button>
                        <button class="layui-btn change_btn btn-left" lay-submit lay-filter="submitStudentMy">保存</button>
                        <button class="layui-btn add_btn btn-left" lay-submit lay-filter="submitStudent">立即提交</button>
                        <button class="layui-btn add_btn btn-left">提交122</button>

                    </div>
                </div>
            </form>
        </div>
    </div>


    <div class="margintop layui-card content-wrap">
        <OBJECT classid="clsid:10946843-7507-44FE-ACE8-2B3483D179B7" id="CVR_IDCard" name="CVR_IDCard" width="0" height="0">
        </OBJECT>

        <div style="text-align:center;">
            <object classid="clsid:454C18E2-8B7D-43C6-8C17-B1825B49D7DE" id="captrue" width="400" height="300"></object>
        </div>

        <p>
        <form method="POST" action="--WEBBOT-SELF--" name="form1">
            <input type="button" value="启动主" name="StartBtn" onclick="Start1_onclick()">
            <input type="button" value="启动副" name="StopBtn" onclick="Start2_onclick()">
            <input type="button" value="停止" name="StopBtn" onclick="Stop_onclick()">
            <input type="button" value="JPG" name="SaveJPGBtn" onclick="SaveJPG_onclick()">

        </form>
        </p>
    </div>
</div>
</div>

</body>



<script>

    var vm = avalon.define({
        $id: "test",
        name: '',//姓名
        sex: '',//性别
        nation: '',//民族
        birthday: '',//出生日期：
        certificatesNumber: '',//证件号码
        issuedAt: '',//签发机关
        effectedDate: '',//身份证有效期 开始
        expiredDate: '',//身份证有效期 结束
        picture: '',//图片编码
        sfType: '',//证件类型
        country: '',//国籍
        studyType: 'first',//学习类别
        phone: '',//手机号码
        carId: '',//准驾车型
        stayAddreeNumber: '',//暂住证编号：
        email: '',//电子邮箱
        registeredAreaId: '',//所属辖区
        addressDetailed: '',//住所详细地址：
        registeredSource: '',//报名来源
        registeredRegionId: '',//登记住所行政区划：
        registeredResidence: '',//登记住所详细地址：
        studentSource: '本地',//来源
        registeredTuition: '',//学费
        studentNumber: '',//学员编号
        registeredTime: '',//报名日期
        //  driversId : document.all['driversId'].value,//(驾校)结构名称  后台获取
        referralCode: '',//(推荐码
        reason: '',//(备注
        myState: '', //提交给谁
        SAMID: '',//模块号码：
        PictureLen: '',//编码长度
        sfz: '',//身份证头像
        mqb: '',//互联网面签协议
        cxjs: '',//初学驾驶申请表
        zjjs: '',//增驾驾驶申请表
        zw: '',//指纹
        ljz: '',//原驾驶证
        zzz: '',//制证照
        pxjl: '',//培训记录
        xszm: '',//学时证明
        zzpermit: '',//居住证照片
        idz: '',//身份证正面
        idf: '',//身份证反面
        healthForm: '',//体检表
        scenePhotos: '',//现场照片
        zjzo: '',//证件照
        tjbtp: '',//提交表图片
        sfzdzz: '',//身份证电子照片
        zcbmqz: '',//册表面签照
        provId_1: '',
        cityId_1: '',
        areaId_1: '',
        provId_2: '',
        cityId_2: '',
        areaId_2: '',
        provlist: [],
        citylist: [],
        arealist: [],
        infolist: [],
        citylist_tow: [],
        arealist_tow: [],
        pro_city_are: {},
        type: '',
        fileShowUrl: fileShowUrl,
        pic:'',//头像
        zjTypeList:[],//证件类型
        carTypeList:[],
        zwimg:'',//指纹图片

        //获取基本信息
        initBaseData: function () {
            ax.get({
                url: schoolWebUrl+"/api/student/getBaseData",

                success: function (res) {
                    if (res.code == 0) {
                        // baseData = res.data;


                        //证件类型
                        vm.zjTypeList=res.data.zjTypeList;
                        //准驾车型
                        vm.carTypeList=res.data.carTypeList;

                        //

                        setTimeout(function () {
                            form.render('select')
                        },300)
                        console.log(res.data);


                        // loadBaseData();
                    } else {
                        layer.msg(res.message);
                    }
                }

            });
        },
        getRegionTree: function () {
            $.ajax({
                url: '../../static/js/addreess.text',  //文件地址
                type: 'GET',     //数据传递方式
                async: false,
                success: function (data) {  //获取数据成功执行的函数
                    var data = JSON.parse(data);
                    var city = data.city;
                    var area = data.area;
                    vm.provlist = data.prove;
                    vm.pro_city_are = data;
                    for (var i in city) {
                        if (city[i].parentId == data.prove[0].id) {
                            vm.citylist.push(city[i])
                            vm.citylist_tow.push(city[i])
                        }
                    }
                    for (var i in area) {
                        if (area[i].parentId == data.city[0].id) {
                            vm.arealist.push(area[i])
                            vm.arealist_tow.push(area[i])
                        }
                    }
                }
            })
        },
        uploadss: function (type) {
            console.log(type)
            vm.type = type;
            $('#upload').click()
        },
        removeimg:function(type){
            vm.type=type;
            if (vm.type == 'cxjs') {
                vm.cxjs = ''
            }
            if (vm.type == 'mqb') {
                vm.mqb = ''
            }
            if (vm.type == 'zw') {
                vm.zw =''
            }
            if (vm.type == 'zjzo') {
                vm.zjzo =''
            }
            if (vm.type == 'ljz') {
                vm.ljz = ''
            }
            if (vm.type == 'idz') {
                vm.idz =''
            }
            if (vm.type == 'idf') {
                vm.idf = ''
            }
            if (vm.type == 'tjbtp') {
                vm.tjbtp = ''
            }
            if (vm.type == 'scenePhotos') {
                vm.scenePhotos = ''
            }
            if (vm.type == 'sfzdzz') {
                vm.sfzdzz = ''
            }
            if (vm.type == 'zcbmqz') {
                vm.zcbmqz = ''
            }
            if (vm.type == 'zzpermit') {
                vm.zzpermit =''
            }

        },
        opeenlay:function(){
            layui.layer.open({
                id:'',
                title : "非本地户籍区域选择",
                type : 2,
                area: ['850px', '350px'],
                // btn:'确定','取消 ['],
                content : "positionList.html",
                yes: function (index,layero) {

                    layer.close(index);
                } ,
                btn2: function (index,layero) {
                    layer.close(index);
                }
            });
            vm.studentSource='非本地'
        },
        //
        jxsq:function (zf) {
            top.layui.layer.open({
                id:'',
                title : "驾驶申请表签字",
                type : 2,
                area: ['90%', '80%'],
                // btn:'确定','取消 ['],
                content : "./school/student/popup/jxsqb.html?zf="+zf,
            });
        },
        //指纹录入
        zhiWenluru:function(zf){
            top.layui.layer.open({
                id:'',
                title : "指纹录入",
                type : 2,
                area: ['90%', '80%'],
                // btn:'确定','取消 ['],
                content : "./school/student/popup/zwlr.html?zf="+zf,
            });
        },
        //面签协议
        mianqian:function(zf){
            top.layui.layer.open({
                id:'',
                title : "面签协议",
                type : 2,
                area: ['90%', '80%'],
                // btn:'确定','取消 ['],
                content : "popup/jxsqb.html?zf="+zf,
            });
        },
        //图片上传
        imgSC:function(type,zf){
            top.layui.layer.open({
                type: 2,
                title:'面签协议',
                area: ['90%', '80%'],
                content : "./school/student/popup/picLuRu.html?zf="+zf+"&fileTypes="+type,
            });
        },

        //读卡点击
        readcard:function(){

            console.log('读卡')
            var CVR_IDCard = document.getElementById("CVR_IDCard");
            var strReadResult = CVR_IDCard.ReadCard();
            if(strReadResult == "0")
            {
                vm.clearDuKa();
                vm.name=CVR_IDCard.Name;
                vm.sex=CVR_IDCard.Sex;
                vm.birthday=CVR_IDCard.Born;
                vm.registeredResidence=CVR_IDCard.Address;
                vm.certificatesNumber=CVR_IDCard.CardNo;
                vm.expiredDate=CVR_IDCard.ExpiredDate;
                vm.picture=CVR_IDCard.Picture;
                vm.pic=CVR_IDCard.Pic;
            } else
            {
                vm.clearDuKa();
                alert(strReadResult);
            }

        },

        //清空读卡信息
        clearDuKa:function(){
            vm.name='';
            vm.sex='';
            vm.birthday='';
            vm.registeredResidence='';
            vm.certificatesNumber='';
            vm.expiredDate='';
            vm.picture='';
            vm.pic='';
            return true;
        },
        //

    })

    vm.$watch('onReady', function () {
        //获取省市区
        console.log(11)
        vm.getRegionTree();
        vm.initBaseData();

    });

    //监听指纹数据
    vm.$watch('zwimg', function () {
        console.log('123');
        console.log(JSON.parse(vm.zwimg))
        vm.zwimglist=JSON.parse(vm.zwimg);
    });


    //图片上传

    var table;
    var layer;
    var baseData = null;
    var form;
    var zpType;
    var upload;

    layui.use(['form', 'laydate', 'layer', 'upload'], function () {
        table = layui.table;
        layer = layui.layer;
        form = layui.form,
            upload = layui.upload,
            laydate = layui.laydate;

        //获取当前时间
        var d = new Date();
        var timenow = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
        document.getElementById('registeredTime').value = timenow;
        //省改变
        form.on('select(provinceSelect)', function (data) {
            console.log(data)
            var provinceid = data.value;

            vm.citylist.clear();
            vm.arealist.clear();
            for (var i in vm.pro_city_are.city) {
                if (provinceid == vm.pro_city_are.city[i].parentId) {
                    vm.citylist.push(vm.pro_city_are.city[i])
                }
            }
            var cityid = vm.citylist[0].id;
            for (var i in vm.pro_city_are.area) {
                if (cityid == vm.pro_city_are.area[i].parentId) {
                    vm.arealist.push(vm.pro_city_are.area[i])
                }
            }
            form.render('select');
            vm.provId_1 = data.value;
        });
        // 市改变
        form.on('select(regionSelect_ae)', function (data) {
            var cityid = data.value;
            return false;
            vm.arealist.clear();
            for (var i in vm.pro_city_are.area) {
                if (cityid == vm.pro_city_are.area[i].parentId) {
                    vm.arealist.push(vm.pro_city_are.area[i])
                }
            }
            form.render('select');
            vm.cityId_1 = data.value;

        });
        // 区改变
        form.on('select(areaSelect)', function (data) {
            vm.areaId_1 = data.value;

        });
        // 省改变
        form.on('select(provinceSelect_tow)', function (data) {
            console.log(data)
            vm.citylist_tow.clear();

            var provinceid = data.value

            for (var i in vm.pro_city_are.city) {
                if (provinceid == vm.pro_city_are.city[i].parentId) {
                    vm.citylist_tow.push(vm.pro_city_are.city[i])
                }
            }
            vm.arealist_tow.clear();
            vm.provId_2 = data.value;
            form.render('select');

        });
        // 市改变
        form.on('select(regionSelect_tow)', function (data) {
            var cityid = data.value;
            vm.arealist_tow.clear();
            for (var i in vm.pro_city_are.area) {
                if (cityid == vm.pro_city_are.area[i].parentId) {
                    vm.arealist_tow.push(vm.pro_city_are.area[i])
                }
            }
            form.render('select');
            vm.cityId_2 = data.value;
        });
        // 区改变
        form.on('select(areaSelect_tow)', function (data) {

            vm.areaId_2 = data.value;

        });
        //总校立即提交
        form.on('submit(submitStudent)', function (data) {
            data.field.myState=0
            console.log(data.field);
            getsubimit(data.field)
            return false
        });
        //提交数据
        function getsubimit(data){


            ax.post({
                url: schoolWebUrl+"/api/student/add",
                data: data,
                contentType: "application/x-www-form-urlencoded",
                success: function (data) {
                    layer.msg(data.message);
                    if (data.code == 0) {
                        //刷新父页面
                        // parent.location.reload();
                        // layer.closeAll("iframe");
                        listStudent();
                    } else {

                    }
                }
            });
            return false;
        }

        form.on('select(county)', function (data) {
            vm.country=data.value;//证件类型
        });

        //保存
        form.on('submit(submitStudentMy)', function (data) {
            data.field.myState=1;
            console.log(data.field)
            getsubimit(data.field)
            return false
        });

        //性别
        form.on('radio(component-form-type)', function (data) {
            vm.sex = data.value;
            form.render('select');

        });


    });

    function listStudent() {
        window.location.href = 'studentList.html';
    }
</script>

</html>